Ext.define('Egitim.view.tanimlar.KullaniciForm', {
	extend: 'Egitim.lib.FormPanel',
    title: 'Kullanici Bilgileri',
    uses: ['Egitim.view.tanimlar.KullaniciTipiCombo'],
	alias: 'widget.kullaniciform',

    // The form will submit an AJAX request to this URL when submitted
    url: 'kullanicis/save',

	katilimciId: '',
	items: [{
	        xtype:'fieldset',
	        columnWidth: 0.5,
	        title: '',
	        border: false,
	        collapsible: false,
	        defaults: {anchor: '100%'},
	        layout: 'column',
	        items :[{
	        	columnWidth: 0.5,
	        	xtype: 'container',
	        	layout: 'form',
		        defaultType: 'textfield',
	        	items: [{
	        		fieldLabel: 'Kullanici Adi',
	        		name: 'username',
	        		allowBlank: false
	        	},{
	        		fieldLabel: 'Sifre',
	        		name: 'password',
	        		inputType: 'password',
	        		itemId: 'sifre',
	        		allowBlank: false
	        	},{
	        		fieldLabel: 'Sifre (tekrar)',
	        		name: 'password',
	        		inputType: 'password',
	        		itemId: 'sifreTekrar',
	        		allowBlank: false
	        	},{
	        		xtype: 'textfield',
	        		name: 'eposta',
	        		fieldLabel: 'E-Posta',
	        		vtype: 'email',
	        		allowBlank: false
	        	},{
	    			xtype: 'kullanicitipicombo',
	    			name: 'rol',
	    			listeners: {
	    				select: function (combo, selected){
	    					var sel = selected[0];
	    					combo.up('form').down('#kurumBilgisi').setVisible(sel.get('key') === 'KUY');
	    				}
	    			}
	    		},{
	    	        xtype:'fieldset',
	    	        columnWidth: 0.5,
	    	        title: 'Kurum Bilgisi',
	    	        collapsible: false,
	    	        defaultType: 'textfield',
	    	        itemId: 'kurumBilgisi',
	    	        defaults: {anchor: '100%'},
	    	        layout: 'column',
	    	        hidden: true,
	    	        items :[
							{
								xtype: 'textfield',
								name: 'kurum_adi',
								fieldLabel: 'Kurum Adi',
								allowBlank: true
							},
							{
								xtype: 'textfield',
								name: 'proje_id',
								fieldLabel: 'Proje Id',
								allowBlank: true
							}
							
	                ]
	        }
	        	
	        	]
	        }]
	    }]
});